﻿using SkypeBotCore;

namespace Commands
{
    using SkypeBot.Commands;
    using SkypeBot.Core;

    class SaveMarasAnswerCommand : IMessageHandler
    {
        [MessageAttribute(@"^!save (?<answer>.*)$")]
        public Responce SaveMarasAnswerToBase(Message message,string answer)
        {
            if (!string.IsNullOrEmpty(answer))
            {
                MarasHandler.Save(answer);
                string strResponce = string.Format("\"{0}\" has been added to the base.", answer);
                return new Responce(strResponce);
            }
            else
            {
                return new Responce("String cannot be null. Please enter correct string value.");
            }
        }
    }
}
